> ## Documentation Index
> Fetch the complete documentation index at: https://sequence-0fb8d9e6-api_docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallets

In the context of SequenceEthereum, a `Wallet` is defined by the `IWallet` interface. There are currently 2 implementations of the `IWallet` interface in this SDK.

## 1. EOAWallet

`EOAWallet` is a standard [EOA wallet](https://ethereum.stackexchange.com/questions/5828/what-is-an-eoa-account) for EVM chains.

An EOAWallet is easily created:

```csharp theme={null}
IWallet eoaWallet = new EOAWallet(); // This will generate a cryptographically random private key
IWallet eoaWallet = new EOAWallet(privateKeyString); // Create a wallet using a previously generated private key
```

## 2. SequenceWalletToEOAWalletAdapter

`SequenceWalletToEOAWalletAdapter` is an adapter that allows you to use a `SequenceWallet` with the same `IWallet` interface as an `EOAWallet` so that it may be used interchangeably with EOA wallets throughout the rest of the SequenceEthereum library.

A SequenceWalletToEOAWalletAdapter is easily created once you have a SequenceWallet:

```csharp theme={null}
IWallet sequenceAdapter = new SequenceWalletToEOAWalletAdapter(sequenceWallet);
```

## Methods

The `IWallet` interface provides a number of methods for you. The most important of which are:

### GetAddress

Returns the `Address` for the wallet

```csharp theme={null}
Address address = wallet.GetAddress();
```

### SendTransaction

Signs the given `EthTransaction` and submits it via the given client

```csharp theme={null}
string transactionHash = await wallet.SendTransaction(client, transaction);
```

### SendTransactionAndWaitForReceipt

Signs the given `EthTransaction` and submits it via the given client then waits for the `TransactionReceipt`

```csharp theme={null}
TransactionReceipt receipt = await wallet.SendTransactionAndWaitForReceipt(client, transaction);
```

### SendTransactionBatch

Signs the given `EthTransaction[]` and submits them via the given client.
If wallet is an `EOAWallet`, the transactions will be submitted sequentially, each of which may pass or fail. If the wallet is a `SequenceWalletToEOAWalletAdapter`, the transactions will be batched together into a single transaction that is submitted all at once and either passes or fails as a whole.
Similarly, if a wallet is an `EOAWallet` the `string[]` (transaction hashes) you receive will be equal in length to the `EthTransaction[]` you submitted. While, if the wallet is a `SequenceWalletToEOAWalletAdapter`, you will only receive one transaction hash (`string[]` of length 1)

```csharp theme={null}
string[] transactionHashes = await wallet.SendTransactionBatch(client, transactions);
```

### SendTransactionBatchAndWaitForReceipts

Signs the given `EthTransaction[]` and submits them via the given client then waits for the `TransactionReceipt[]`.
If wallet is an `EOAWallet`, the transactions will be submitted sequentially, each of which may pass or fail. If the wallet is a `SequenceWalletToEOAWalletAdapter`, the transactions will be batched together into a single transaction that is submitted all at once and either passes or fails as a whole.
Similarly, if a wallet is an `EOAWallet` the `TransactionReceipt[]` you receive will be equal in length to the `EthTransaction[]` you submitted. While, if the wallet is a `SequenceWalletToEOAWalletAdapter`, you will only receive one transaction receipt (`TransactionReceipt[]` of length 1)

```csharp theme={null}
TransactionReceipt[] receipts = await wallet.SendTransactionAndWaitForReceipt(client, transactions);
```

### SignMessage

Given a message and an optional chain id, sign the message using the wallet. Omit the chain id from the signature if not provided

```csharp theme={null}
string signedMessage = await wallet.SignMessage(message, chainId)
```

Note: the chainId is expected to be in hexadecimal format. If you are working with a `Chain` object (recommended), you can use the `AsString` method to get the hexadecimal format of the chain id

```csharp theme={null}
string signedMessage = await wallet.SignMessage(message, Chain.Polygon.AsString());
```
